/**
 * @program: LeetCode
 * @description: LeetCode : 爬楼梯
 * @author: WXY
 * @create: 2023-01-02 19:58
 * @Version 1.0
 **/
public class code_climbStairs {
    public int climbStairs(int n) {
        int[] dp = new int[50];
        dp[1] = 1;
        dp[2] = 2;
        for (int i = 3; i < 50; i++) {
            dp[i] = dp[i - 1] + dp[i - 2];
        }
        return dp[n];
    }
}
